import request from '@/utils/request'

// 创建支付宝支付订单
export const createAlipayOrder = (data) => {
  return request({
    url: '/payment/alipay/create',
    method: 'post',
    params: { 
      orderId: data.orderId,
      amount: data.amount
    }
  })
}

// 创建微信支付订单
export const createWechatOrder = (orderId) => {
  return request({
    url: '/payment/wechat/create',
    method: 'post',
    params: { orderId }
  })
}

// 查询支付结果
export const queryPaymentResult = (orderId) => {
  return request({
    url: '/payment/query',
    method: 'get',
    params: { orderId }
  })
}

// 更新订单支付状态
export function updateOrderStatus(orderId, status, paymentMethodId, daId) {
  return request({
    url: '/payment/updateStatus',
    method: 'post',
    params: {
      orderId,
      status,
      paymentMethodId,
      daId
    }
  })
}

// 查询支付状态
export function queryPaymentStatus(orderId) {
  return request({
    url: '/payment/query',
    method: 'get',
    params: { orderId }
  })
} 